package org.eclipselabs.egf.portfolio.task.scala.test.biginteger

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction
import java.math.BigInteger

class BigIntegerEquals extends ITaskProduction{
	var a1 = new BigInteger("19")
	var b1 = new BigInteger("1654")
	var c1 = new BigInteger("31322")
	var d1 = new BigInteger("32976")
	var e1 = new BigInteger("34630")
	var f1 = new BigInteger("54542304")
	
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
		
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={

		var a = taskProductionContext.getInputValue("inA", classOf[BigInteger])
		var b = taskProductionContext.getInputValue("inB", classOf[BigInteger])
		var c = taskProductionContext.getInputValue("inC", classOf[BigInteger])
		var d = taskProductionContext.getInputValue("inD", classOf[BigInteger])
		var e = taskProductionContext.getInputValue("inE", classOf[BigInteger])
		var f = taskProductionContext.getInputValue("inF", classOf[BigInteger])
		if(a.compareTo(a1) == 0 && b.compareTo(b1) == 0
				&& c.compareTo(c1) == 0 && d.compareTo(d1) == 0
				&& e.compareTo(e1) == 0 && f.compareTo(f1) == 0)
			EGFCorePlugin.getDefault().logWarning("Test Passed")
		else
			EGFCorePlugin.getDefault().logError("Test Failed")
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={

	}
}